#include <iostream>
#include <vector>
#include <string>

#include <iostream>
#include <string>

void printAllSubstrings(const std::string& str) {
    int n = str.length();
    for (int start = 0; start < n; ++start) {
        for (int end = start + 1; end <= n; ++end) {
            std::cout << str.substr(start, end - start) << std::endl;
        }
    }
}

int main() {
    std::string input = "abc";
    printAllSubstrings(input);
    return 0;
}